package cn.xiangxu.webfulx_structure.controller;

import lombok.extern.slf4j.Slf4j;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import reactor.core.publisher.Flux;
import cn.xiangxu.webfulx_structure.domain.StudentDO;
import cn.xiangxu.webfulx_structure.repository.StudentReporitory;

@RestController
@RequestMapping(value = "/test")
@Slf4j
public class TestController {

	private final StudentReporitory studentReporitory;

	public TestController(StudentReporitory studentReporitory) {

		this.studentReporitory = studentReporitory;
	}

	@GetMapping(value = "/connect")
	public String connect() {

		String result = "前后台连接成功_王杨帅";
		log.info(result);
		return result;
	}

	@GetMapping(value = "/test01")
	public Flux<StudentDO> test01() {

		return studentReporitory.findAll();
	}

}
